package service.impl;

import dao.PersonDao;
import dao.impl.PersonDaoImpl;
import entity.Person;
import service.PersonService;

import java.sql.SQLException;
import java.util.List;

public class PersonServiceImpl implements PersonService {
    PersonDao dao = new PersonDaoImpl();
    @Override
    public boolean delPerson(int pid) throws SQLException, ClassNotFoundException {
        return dao.delPerson(pid);
    }

    @Override
    public List<Person> getPersonList() throws SQLException, ClassNotFoundException {
        return dao.getPersonList() ;
    }

    @Override
    public boolean addPerson(String name, String sex, int age, String rank, String department) throws SQLException, ClassNotFoundException {
        return dao.addPerson(name, sex, age, rank, department);
    }
    @Override
    public boolean updatePerson(String name, String sex, Integer age, String rank, String department, Integer id) throws SQLException, ClassNotFoundException {
        return dao.updatePerson(name, sex, age, rank, department, id);
    }
}
